package lng.site.tatoo.dao;

import java.util.List;
import java.sql.Timestamp;

import lng.site.tatoo.IDao.TatooUserRoleIDAO;
import lng.site.tatoo.model.TatooUserRole;
import lng.site.tatoo.model.TatooUserRolePK;

import org.hibernate.criterion.Restrictions;

/**
*
 */
public class TatooUserRoleDAO extends
		AbstractDAO<TatooUserRole, TatooUserRolePK> implements
		TatooUserRoleIDAO {

	/**
	 * Find TatooUserRole by tatooUserId
	 */
	@SuppressWarnings("unchecked")
	public List<TatooUserRole> findByTatooUserId(Integer tatooUserId) {
		return findByCriteria(Restrictions.eq("tatooUser.tatooUserId", tatooUserId));
	}
	
	/**
	 * Find TatooUserRole by tatooRoleId
	 */
	@SuppressWarnings("unchecked")
	public List<TatooUserRole> findByTatooRoleId(Integer tatooRoleId) {
		return findByCriteria(Restrictions.eq("tatooRole.tatooRoleId", tatooRoleId));
	}
	

}
